home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3dm / video / vlmatchfloat.z / vlmatchfloat
Encoding:
Text File  |  1998-10-20  |  13.5 KB  |  199 lines

  1.  
  2.  
  3.  
  4. VVVVLLLLMMMMAAAATTTTCCCCHHHHFFFFLLLLOOOOAAAATTTT((((3333ddddmmmm))))                                            VVVVLLLLMMMMAAAATTTTCCCCHHHHFFFFLLLLOOOOAAAATTTT((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      vlMatchFloat, vlMatchFraction, vlFractionCount, vlMatchFractionInList,
  10.      vlFractionList - VL fraction list utility functions
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////vvvvllll....hhhh>>>>
  14.  
  15.      VVVVLLLLBBBBoooooooolllleeeeaaaannnn vvvvllllMMMMaaaattttcccchhhhFFFFllllooooaaaatttt ((((
  16.          ddddoooouuuubbbblllleeee ggggiiiivvvveeeennnn              ////**** iiiinnnn:::: tttthhhheeee ffffllllooooaaaattttiiiinnnngggg ppppooooiiiinnnntttt vvvvaaaalllluuuueeee ****////,,,,
  17.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnnRRRRaaaannnnggggeeee ****rrrraaaannnnggggeeeessss   ////**** iiiinnnn:::: tttthhhheeee rrrraaaannnnggggeeee lllliiiisssstttt ttttoooo ccccoooommmmppppaaaarrrreeee wwwwiiiitttthhhh ****////,,,,
  18.          iiiinnnntttt nnnnrrrraaaannnnggggeeeessss               ////**** iiiinnnn:::: tttthhhheeee nnnnuuuummmmbbbbeeeerrrr ooooffff rrrraaaannnnggggeeeessss iiiinnnn tttthhhheeee lllliiiisssstttt ****////,,,,
  19.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnn ****lllloooowwwweeeerrrr         ////**** oooouuuutttt:::: tttthhhheeee cccclllloooosssseeeesssstttt lllloooowwwweeeerrrr ffffrrrraaaaccccttttiiiioooonnnn ****////,,,,
  20.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnn ****hhhhiiiigggghhhheeeerrrr        ////**** oooouuuutttt:::: tttthhhheeee cccclllloooosssseeeesssstttt hhhhiiiigggghhhheeeerrrr ffffrrrraaaaccccttttiiiioooonnnn ****////
  21.      ))));;;;
  22.      VVVVLLLLBBBBoooooooolllleeeeaaaannnn vvvvllllMMMMaaaattttcccchhhhFFFFrrrraaaaccccttttiiiioooonnnn ((((
  23.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnn ****ggggiiiivvvveeeennnn         ////**** iiiinnnn:::: tttthhhheeee ffffrrrraaaaccccttttiiiioooonnnn ttttoooo ccccoooommmmppppaaaarrrreeee ****////,,,,
  24.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnnRRRRaaaannnnggggeeee ****rrrraaaannnnggggeeeessss   ////**** iiiinnnn:::: tttthhhheeee rrrraaaannnnggggeeee lllliiiisssstttt ttttoooo ccccoooommmmppppaaaarrrreeee wwwwiiiitttthhhh ****////,,,,
  25.          iiiinnnntttt nnnnrrrraaaannnnggggeeeessss               ////**** iiiinnnn:::: tttthhhheeee nnnnuuuummmmbbbbeeeerrrr ooooffff rrrraaaannnnggggeeeessss iiiinnnn tttthhhheeee lllliiiisssstttt ****////,,,,
  26.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnn ****lllloooowwwweeeerrrr         ////**** oooouuuutttt:::: tttthhhheeee cccclllloooosssseeeesssstttt lllloooowwwweeeerrrr ffffrrrraaaaccccttttiiiioooonnnn ****////,,,,
  27.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnn ****hhhhiiiigggghhhheeeerrrr        ////**** oooouuuutttt:::: tttthhhheeee cccclllloooosssseeeesssstttt hhhhiiiigggghhhheeeerrrr ffffrrrraaaaccccttttiiiioooonnnn ****////
  28.      ))));;;;
  29.      iiiinnnntttt vvvvllllFFFFrrrraaaaccccttttiiiioooonnnnCCCCoooouuuunnnntttt ((((
  30.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnnRRRRaaaannnnggggeeee ****rrrraaaannnnggggeeeessss,,,,
  31.          iiiinnnntttt nnnnrrrraaaannnnggggeeeessss
  32.      ))));;;;
  33.      VVVVLLLLBBBBoooooooolllleeeeaaaannnn vvvvllllMMMMaaaattttcccchhhhFFFFrrrraaaaccccttttiiiioooonnnnIIIInnnnLLLLiiiisssstttt ((((
  34.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnn ****ggggiiiivvvveeeennnn      ////**** iiiinnnn:::: tttthhhheeee ffffrrrraaaaccccttttiiiioooonnnn ttttoooo ffffiiiinnnndddd ****////,,,,
  35.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnn ****rrrraaaannnnggggeeeessss          ////**** iiiinnnn:::: tttthhhheeee lllliiiisssstttt ttttoooo sssseeeeaaaarrrrcccchhhh ****////,,,,
  36.          iiiinnnntttt ccccoooouuuunnnntttt                 ////**** iiiinnnn:::: lllleeeennnnggggtttthhhh ooooffff lllliiiisssstttt ****////,,,,
  37.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnn ****lllloooowwwweeeerrrr         ////**** oooouuuutttt:::: nnnneeeeaaaarrrreeeesssstttt lllloooowwwweeeerrrr ffffrrrraaaaccccttttiiiioooonnnn ****////,,,,
  38.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnn ****hhhhiiiigggghhhheeeerrrr        ////**** oooouuuutttt:::: nnnneeeeaaaarrrreeeesssstttt hhhhiiiigggghhhheeeerrrr ffffrrrraaaaccccttttiiiioooonnnn ****////,,,,
  39.          iiiinnnntttt ****iiiinnnnddddeeeexxxx____rrrreeeettttuuuurrrrnnnn         ////**** oooouuuutttt:::: iiiinnnnddddeeeexxxx ooooffff lllloooowwwweeeerrrr ****////
  40.      ))));;;;
  41.      VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnn **** vvvvllllFFFFrrrraaaaccccttttiiiioooonnnnLLLLiiiisssstttt((((
  42.          VVVVLLLLFFFFrrrraaaaccccttttiiiioooonnnnRRRRaaaannnnggggeeee ****rrrraaaannnnggggeeee ,,,,
  43.          iiiinnnntttt nnnnrrrraaaannnnggggeeeessss ,,,,
  44.          iiiinnnntttt ****lllleeeennnnggggtttthhhh____rrrreeeettttuuuurrrrnnnn
  45.      ))));;;;
  46.  
  47. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  48.      _g_i_v_e_n          Specifies the fraction to be checked.  In the case of
  49.                     vvvvllllMMMMaaaattttcccchhhhFFFFllllooooaaaatttt it is a _d_o_u_b_l_e, and in the others it is a
  50.                     pointer to a fraction.
  51.  
  52.      _r_a_n_g_e_s         Specifies the fraction range list to be compared against.
  53.  
  54.      _n_r_a_n_g_e_s        Specifies the number of fraction ranges in the list.
  55.  
  56.      _l_o_w_e_r          Returns the nearest lower or equivalent fraction in the
  57.                     range.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. VVVVLLLLMMMMAAAATTTTCCCCHHHHFFFFLLLLOOOOAAAATTTT((((3333ddddmmmm))))                                            VVVVLLLLMMMMAAAATTTTCCCCHHHHFFFFLLLLOOOOAAAATTTT((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.      _h_i_g_h_e_r         Returns the nearest higher or equivalent fraction in the
  75.                     range.
  76.  
  77.      _i_n_d_e_x__r_e_t_u_r_n   Returns the index of lower.
  78.  
  79. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  80.      If successful, vvvvllllMMMMaaaattttcccchhhhFFFFrrrraaaaccccttttiiiioooonnnn and vvvvllllMMMMaaaattttcccchhhhFFFFllllooooaaaatttt return _T_R_U_E if _g_i_v_e_n is
  81.      numerically equal to a fraction in one of the fraction ranges in _r_a_n_g_e_s,
  82.      in which case _l_o_w_e_r and _h_i_g_h_e_r are returned numerically equal to _g_i_v_e_n,
  83.      with the smallest values for numerator and denominator within range.  For
  84.      example, if given is 22/33, lower and higher could be 2/3 even if 22/33
  85.      is also in range.
  86.  
  87.      vvvvllllMMMMaaaattttcccchhhhFFFFrrrraaaaccccttttiiiioooonnnn and vvvvllllMMMMaaaattttcccchhhhFFFFllllooooaaaatttt return _F_A_L_S_E otherwise. If _g_i_v_e_n is
  88.      between the highest and lowest fractions in all the fraction ranges in
  89.      _r_a_n_g_e_s, then _l_o_w_e_r is the closest fraction in _r_a_n_g_e_s of less value and
  90.      _h_i_g_h_e_r is the closest fraction in _r_a_n_g_e_s of greater value.  If _g_i_v_e_n is
  91.      below the lowest fraction in _r_a_n_g_e_s, both _l_o_w_e_r and _h_i_g_h_e_r are that
  92.      lowest fraction, while if above both are the highest.
  93.  
  94.      One use of this function is to make sure a _s_o_u_r_c_e and _d_r_a_i_n match
  95.      according to the _V_L__S_I_Z_E control ranges, so that the size of the window
  96.      can match the available ranges.
  97.  
  98.      In the case of vvvvllllMMMMaaaattttcccchhhhFFFFllllooooaaaatttt the fraction is limited in precision, and may
  99.      not match fractions with denominators with ranges greater than 10,000
  100.      elements.
  101.  
  102.      vvvvllllMMMMaaaattttcccchhhhFFFFrrrraaaaccccttttiiiioooonnnnIIIInnnnLLLLiiiisssstttt returns _T_R_U_E if _g_i_v_e_n is numerically equal to a
  103.      fraction in _l_i_s_t, in which case _l_o_w_e_r and _h_i_g_h_e_r are both some fraction
  104.      that is numerically equivalent to _g_i_v_e_n.
  105.  
  106.      vvvvllllMMMMaaaattttcccchhhhFFFFrrrraaaaccccttttiiiioooonnnnIIIInnnnLLLLiiiisssstttt returns _F_A_L_S_E otherwise.  If _g_i_v_e_n is between the
  107.      highest and lowest fractions in _l_i_s_t, then _l_o_w_e_r is the closest fraction
  108.      of less value and _h_i_g_h_e_r is the closest fraction of greater value.  If
  109.      _g_i_v_e_n is below the lowest fraction in _l_i_s_t, both _l_o_w_e_r and _h_i_g_h_e_r are
  110.      that lowest fraction ( _i_n_d_e_x__r_e_t_u_r_n is 0).  If _g_i_v_e_n is above the highest
  111.      fraction in _l_i_s_t, both _l_o_w_e_r and _h_i_g_h_e_r are that highest fraction
  112.      (_i_n_d_e_x__r_e_t_u_r_n is count - 1).
  113.  
  114.      vvvvllllFFFFrrrraaaaccccttttiiiioooonnnnLLLLiiiisssstttt returns a list of fractions, with 0 occurring at most
  115.      once.  The list is in numerical order, least first, with numerically
  116.      equivalent fractions in no particular order.
  117.  
  118.      This function is intended for use with small fraction ranges, such as may
  119.      be found in the VL_RATE control description.  Fraction ranges in the
  120.      ranges of VL_WINDOW controls or control structures can be too large for
  121.      this function, which allocates the memory for the list.  If in doubt, use
  122.      vvvvllllFFFFrrrraaaaccccttttiiiioooonnnnCCCCoooouuuunnnntttt to see how big the list will be before using this
  123.      function.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. VVVVLLLLMMMMAAAATTTTCCCCHHHHFFFFLLLLOOOOAAAATTTT((((3333ddddmmmm))))                                            VVVVLLLLMMMMAAAATTTTCCCCHHHHFFFFLLLLOOOOAAAATTTT((((3333ddddmmmm))))
  137.  
  138.  
  139.  
  140.      To free the data returned by this function, use ffffrrrreeeeeeee(3C).
  141.  
  142.      vvvvllllFFFFrrrraaaaccccttttiiiioooonnnnCCCCoooouuuunnnntttt returns the number of fractions in the list of fraction
  143.      ranges, which can be used to determine whether to use vlFractionList,
  144.      above.
  145.  
  146.      In all functions, a value of _F_A_L_S_E indicates an error.
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.